<template>
  <div class="my-header" :style="{ color: color, backgroundColor: bgc }">
    {{ title }}
  </div>
</template>

<script>
export default {
  // 接受title，color，bgc
  props: {
    title: String, //类型为字符串
    color: {
      type: String,
      default: '#fff', //默认值为#fff
    },
    bgc: {
      type: String,
      required: true, //必须传入
    },
  },
}
</script>

<style lang="less" scoped>
.my-header {
  height: 45px;
  line-height: 45px;
  text-align: center;
  background-color: #1d7bff;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2;
}
</style>
